/**
 * =====================================================================================
 *       @file  ngx_cycle.h
 *      @brief  
 *
 *  Detailed description starts here.
 *
 *   @internal
 *     Created  2012年05月08日 21时45分37秒 
 *    Revision  1.0.0.0
 *    Compiler  gcc/g++
 *
 *     @author  luis
 * =====================================================================================
 */

#ifndef H_NGX_CYCLE_H_INCLUDE_
#define H_NGX_CYCLE_H_INCLUDE_

#include "ngx_core.h"
#include "ngx_array.h"
#include "ngx_config.h"

#ifndef NGX_CYCLE_POOL_SIZE
#define NGX_CYCLE_POOL_SIZE     16384
#endif

struct ngx_cycle_s 
{
    ngx_pool_t          *pool;
    ngx_connection_t    *connections; 
    ngx_event_t         *read_events;
    ngx_event_t         *write_events;
    ngx_array_t          listening;
    ngx_uint_t           connection_n;

    ngx_connection_t    *free_connections;
    ngx_uint_t           free_connection_n;
};

ngx_cycle_t *ngx_init_cycle();

extern volatile ngx_cycle_t *ngx_cycle;

#endif
